Skip to main content

Simple Container Component

1. Introduction

The Simple Container component is a versatile layout element used to group and organize other components within an application. It acts as a container for content, providing structure and styling options to enhance the design and functionality of the application. The Simple Container is highly customizable, making it suitable for a wide range of use cases.

Purpose and Use Cases

  • Purpose: The Simple Container component is used to group, align, and style other components or content within an application.
  • Primary Use Cases:
    • Creating structured layouts for forms, cards, or sections.
    • Wrapping multiple components to apply consistent styling or behavior.
    • Organizing content into grids or flexible layouts.

Benefits

  • Flexible Layouts: Supports grid-based and freeform layouts for responsive design.
  • Customizable: Offers extensive styling options for borders, backgrounds, shadows, and more.
  • Improved Organization: Simplifies the management of grouped components.
  • Cross-Platform Compatibility: Works seamlessly across desktop, tablet, and mobile devices.

2. Properties

The Simple Container component comes with several configurable properties to suit different use cases. Below is a detailed breakdown:

Code

  • Description: A unique identifier for the component.
  • Purpose: Used to reference the component programmatically.
  • Required/Optional: Required

Tooltip

  • Description: A text message displayed when the user hovers over the container.
  • Purpose: Provides additional context or information about the container.
  • Required/Optional: Optional

3. Style

The Simple Container component offers extensive styling options to ensure it aligns with the application's design. Below are the key styling properties:

Size and Position

  • Reset: Resets size and position settings to default.
  • Size:
    • Width & Height: Define the container's dimensions.
    • Min Size: Minimum width and height (default: none).
    • Max Size: Maximum width and height (default: none).
  • Position:
    • Alignment: Left, right, top, bottom (default: left, top).
    • X Position: Horizontal offset from the edge.
    • Y Position: Vertical offset from the edge.
  • Z-Index: Specifies the stack order of the container (default: 0).
  • Fixed Position: Locks the container's position on the screen (default: OFF).
  • Hidden: Hides the container from view (default: OFF).

Grid

  • Reset: Resets grid settings to default.
  • Columns: Number of columns in the grid (default: 12).
  • Column Gap Size: Space between columns, in pixels (default: 20px).
  • Column Color: Color of the grid columns (default: #ffe6e4).
  • Rows: Number of rows in the grid (default: 12).
  • Row Gap Size: Space between rows, in pixels (default: 20px).
  • Row Color: Color of the grid rows (default: #fe645a).
  • Snap: Snap-to-grid spacing, in pixels (default: 10).
  • Show Grid: Toggles the visibility of the grid (default: OFF).

Overflow

  • Options: Normal, On Hover.
  • Overflow X: Controls horizontal overflow (visible, hidden, scroll, auto, initial, inherit).
  • Overflow Y: Controls vertical overflow (visible, hidden, scroll, auto, initial, inherit).

Border

  • Reset: Resets border settings to default.
  • Options: Normal, On Hover.
    • Edges: Left, right, top, bottom, or all edges.
    • Type: None, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset, initial, inherit (default: none).
    • Color: Hexadecimal color code with a color picker.
    • Width: Border width in pixels.
    • Radius: Corner radius for rounded edges (default: none).

Padding

  • Reset: Resets padding settings to default.
  • Options: Normal, On Hover.
    • Sides: Left, right, top, bottom, or all edges.
    • Size: Padding size in pixels.

Background

  • Reset: Resets background settings to default.
  • Normal:
    • Background Color: Hexadecimal color code with a color picker (default: none).
    • Source: Media library or HTTP URL.
    • Attachment: Scroll, fixed, local, initial, inherit.
    • Position: X and Y positions in pixels (default: 0).
    • Repeat: Repeat, repeat-x, repeat-y, no-repeat, initial, inherit.
    • Size: Auto, length, cover, contain, initial, inherit.
    • Origin: Border-box, padding-box, content-box, initial, inherit.
  • On Hover:
    • Same properties as "Normal" but applied when the container is hovered.

Shadow

  • Reset: Resets shadow settings to default.
  • Normal:
    • Color: Hexadecimal color code with a color picker (default: none).
    • Offset X: Horizontal spacing in pixels.
    • Offset Y: Vertical spacing in pixels.
    • Blur Radius: The amount of blur applied to the shadow.
    • Spread Radius: The size of the shadow spread.
    • Inset: Applies the shadow inside the element (default: OFF).
  • On Hover:
    • Same properties as "Normal" but applied when the container is hovered.

Cursor

  • Reset: Resets cursor settings to default.
  • Options: Auto, default, none, context-menu, help, pointer, progress, wait, cell, crosshair, text, vertical-text, alias, copy, move, no-drop, not-allowed, grab, wait, all-scroll, col-resize, row-resize, n-resize, e-resize, s-resize, w-resize, ne-resize, nw-resize, se-resize, sw-resize, ew-resize, ns-resize, neswe-resize, nesw-resize, zoom-in, zoom-out.

Font

  • Reset: Resets font settings to default.
  • Options: Normal, On Hover, On Focus.
    • Font Size: Pixels (default: 14).
    • Letter Spacing: Number expressed in em, px, or rem units.
    • Word Spacing: Number expressed in em, px, or rem units.
    • Line Height: Number expressed in em, px, or rem units.
    • Weight: Thin, light, extra light, normal, medium, semi-bold, bold, extra bold, black (default: normal).
    • Color: Hexadecimal color code with a color picker (default: none).
    • Text Decoration: Line, style, thickness, and color options.

4. Best Practices for UI/UX

When and Why to Use

  • Use the Simple Container component to group and organize content for better structure and design.
  • Ideal for creating responsive layouts, such as forms, cards, or sections.

Effective Scenarios

  • Desktop: Use for structured layouts with grid-based designs.
  • Tablet/Smartphone: Ensure the container is responsive and adapts to smaller screens.

Tips for Optimal Use

  • Use the grid settings to create consistent and aligned layouts.
  • Apply shadows and borders to visually separate the container from other elements.
  • Use tooltips to provide additional context or instructions for users.

5. Security Considerations

Potential Risks

  • External Resources: Validate any external resources used for backgrounds or media.
  • Overflow Content: Ensure that hidden or scrollable content does not expose sensitive information.

Best Practices

  • Use HTTPS for secure communication when loading external resources.
  • Validate and sanitize all user inputs to prevent injection attacks.
  • Test the container's responsiveness and behavior across different devices and screen sizes.